package com.bestcem.xm.common.core.constant;

/**
 * 资源错误基类，错误码必须落于200~299之间，包含200和299
 * <p>
 * 处理诸如：资源不存在、请求资源过于频繁、上传资源格式不正确等资源异常。
 *
 * @author ympan <yuming.pan@idiaoyan.com>
 * @version v3.0
 * @date 2021/8/17 14:21
 */
public class ResourceErrorCodeConstants {

    private ResourceErrorCodeConstants() {
    }

    public static final int CODE_MIN = 200;
    public static final int CODE_MAX = 299;

    /**
     * 资源不存在
     */
    public static final int NOT_FOUND = CODE_MIN + 1;

    /**
     * 请求过于频繁
     */
    public static final int TOO_BUSY = CODE_MIN + 2;

    /**
     * 上传资源格式不正确
     */
    public static final int INVALID_FORMAT = CODE_MIN + 3;

    /**
     * 重复操作相同资源
     */
    public static final int DUPLICATE = CODE_MIN + 4;

    /**
     * mongo写入数据异常
     */
    public static final int WRITE_FAIL = CODE_MIN + 5;

    /**
     * 更新操作被拒绝
     */
    public static final int UPDATE_FORBID = CODE_MIN + 6;

    /**
     * 没有权限
     */
    public static final int PERMISSION_DENY = CODE_MIN + 7;

    /**
     * 资源状态已变化，当前操作被拒绝
     */
    public static final int STATUS_CHANGED = CODE_MIN + 8;

    /**
     * 资源被禁用，或者资源状态为无效状态，未启用等
     */
    public static final int FORBIDDEN = CODE_MIN + 9;

    /**
     * 用户不在组中
     */
    public static final int OUT_OF_GROUP = CODE_MIN + 10;

    /**
     * 第三方资源申请失败
     */
    public static final int THIRD_PART = CODE_MIN + 11;

    /**
     * 资源被引用无法删除
     */
    public static final int DELETE_INHIBIT = CODE_MIN + 12;

    /**
     * 数据不存在
     */
    public static final int NO_DATA = CODE_MIN + 13;

    /**
     * 图表计算失败
     */
    public static final int CHART_FAILED = CODE_MIN + 14;

    /**
     * 图表计算进行中
     */
    public static final int CHART_CALCING = CODE_MIN + 15;

    /**
     * 图表因为使用层级字段而出错
     */
    public static final int CHART_ERROR = CODE_MIN + 16;

    /**
     * 子系统不存在
     */
    public static final int SUB_SYSTEM_NOT_FOUND = CODE_MIN + 17;

    /**
     * 资源已存在
     */
    public static final int FOUND = CODE_MIN + 18;

    /**
     * 缓存不命中
     */
    public static final int CACHE_MISSED = CODE_MIN + 19;

    /**
     * 资源数量过多
     */
    public static final int TOO_MUCH = CODE_MIN + 20;

    /**
     * 没有相关定制化功能
     */
    public static final int NOT_EXISTS_CUSTOM_FUNCTION = CODE_MIN + 21;

    /**
     * 数据不容许删除
     */
    public static final int DATA_NOT_ALLOW_DELETE = CODE_MIN + 22;

    /**
     * 微信绑定用户未找到
     */
    public static final int WX_USER_NOT_FOUND = CODE_MIN + 23;

    /**
     * 微信已绑定用户
     */
    public static final int WX_USER_FOUND = CODE_MIN + 24;

    /**
     * 当前task正在执行
     */
    public static final int TASK_WORKING = CODE_MIN + 25;

    /**
     * 中台接口不可用
     */
    public static final int MIDDLE_NOT_FOUND = CODE_MIN + 26;

    /**
     * 项目为初始化
     */
    public static final int NO_INIT = CODE_MIN + 27;

    /**
     * 账号被锁定
     */
    public static final int USER_LOCKED = CODE_MIN + 28;

    /**
     * ticket has deleted
     */
    public static final int TICKET_DELETED = CODE_MIN + 29;

    /**
     * org没有权限
     */
    public static final int ORG_FORBIDDEN = CODE_MIN + 30;
}
    